package test3_17.Account;

public class Homework9_6_Test {
    public static void main(String[] args) {

        Account account = new Account("1122", 20000, 0.045);

        account.withdraw(30000);
        System.out.println("当前余额: " + account.getBalance());

        account.withdraw(2500);
        account.deposit(3000);
        System.out.println("最终余额: " + account.getBalance());
        System.out.println("月利率: " + (account.getMonthlyInterest() * 100) + "%");

        CheckAccount checkAccount = new CheckAccount("1122", 20000, 0.045, 5000);

        checkAccount.withdraw(5000);
        System.out.printf("余额:"+checkAccount.getBalance()+ "透支额:"+checkAccount.getOverdraft());

        checkAccount.withdraw(18000);
        System.out.printf("余额:"+checkAccount.getBalance()+ "透支额:"+checkAccount.getOverdraft());

        checkAccount.withdraw(3000);
        System.out.printf("余额:"+checkAccount.getBalance()+ "透支额:"+checkAccount.getOverdraft());
    }
}
